﻿using System;
using System.Collections.Generic;


/// <summary>
/// 套装随机属性
/// </summary>
[Serializable]
public class SuitRandProperty
{
    public List<List<PropertyValue<object>>> propertyList = new List<List<PropertyValue<object>>>();

    public SuitRandProperty()
    {
        var thorns = new List<PropertyValue<object>>();
        thorns.Add(new PropertyValue<object>(2, GMConfig.KeyType.PercentKey + "thorns", GMConfig.PropertyType.Thorns));//反伤
        thorns.Add(null);
        thorns.Add(new PropertyValue<object>(4, GMConfig.KeyType.PercentKey + "thorns", GMConfig.PropertyType.Thorns));//反伤
        thorns.Add(null);
        thorns.Add(new PropertyValue<object>(6, GMConfig.KeyType.PercentKey + "thorns", GMConfig.PropertyType.Thorns));//反伤

        var puppetBlood = new List<PropertyValue<object>>();
        puppetBlood.Add(new PropertyValue<object>(2, GMConfig.KeyType.PercentKey + "puppetBlood", GMConfig.PropertyType.PuppetBlood));//傀儡血量
        puppetBlood.Add(null);
        puppetBlood.Add(new PropertyValue<object>(4, GMConfig.KeyType.PercentKey + "puppetBlood", GMConfig.PropertyType.PuppetBlood));//傀儡血量
        puppetBlood.Add(null);
        puppetBlood.Add(new PropertyValue<object>(6, GMConfig.KeyType.PercentKey + "puppetBlood", GMConfig.PropertyType.PuppetBlood));//傀儡血量

        var baseBlood = new List<PropertyValue<object>>();
        baseBlood.Add(new PropertyValue<object>(2, GMConfig.KeyType.AddKey + "blood", GMConfig.PropertyType.BaseBlood));//基础血量
        baseBlood.Add(null);
        baseBlood.Add(new PropertyValue<object>(4, GMConfig.KeyType.AddKey + "blood", GMConfig.PropertyType.BaseBlood));//基础血量
        baseBlood.Add(null);
        baseBlood.Add(new PropertyValue<object>(6, GMConfig.KeyType.AddKey + "blood", GMConfig.PropertyType.BaseBlood));//基础血量

        var fireResistance = new List<PropertyValue<object>>();
        fireResistance.Add(new PropertyValue<object>(2, GMConfig.KeyType.PercentKey + "fireResistance", GMConfig.PropertyType.FireResistance));//火抗
        fireResistance.Add(null);
        fireResistance.Add(new PropertyValue<object>(4, GMConfig.KeyType.PercentKey + "fireResistance", GMConfig.PropertyType.FireResistance));//火抗
        fireResistance.Add(null);
        fireResistance.Add(new PropertyValue<object>(6, GMConfig.KeyType.PercentKey + "fireResistance", GMConfig.PropertyType.FireResistance));//火抗

        var iceResistance = new List<PropertyValue<object>>();
        iceResistance.Add(new PropertyValue<object>(2, GMConfig.KeyType.PercentKey + "iceResistance", GMConfig.PropertyType.IceResistance));//冰抗
        iceResistance.Add(null);
        iceResistance.Add(new PropertyValue<object>(4, GMConfig.KeyType.PercentKey + "iceResistance", GMConfig.PropertyType.IceResistance));//冰抗
        iceResistance.Add(null);
        iceResistance.Add(new PropertyValue<object>(6, GMConfig.KeyType.PercentKey + "iceResistance", GMConfig.PropertyType.IceResistance));//冰抗

        var toxicResistance = new List<PropertyValue<object>>();
        toxicResistance.Add(new PropertyValue<object>(2, GMConfig.KeyType.PercentKey + "toxicResistance", GMConfig.PropertyType.ToxicResistance));//毒抗
        toxicResistance.Add(null);
        toxicResistance.Add(new PropertyValue<object>(4, GMConfig.KeyType.PercentKey + "toxicResistance", GMConfig.PropertyType.ToxicResistance));//毒抗
        toxicResistance.Add(null);
        toxicResistance.Add(new PropertyValue<object>(6, GMConfig.KeyType.PercentKey + "toxicResistance", GMConfig.PropertyType.ToxicResistance));//毒抗

        var blockResistance = new List<PropertyValue<object>>();
        blockResistance.Add(new PropertyValue<object>(2, GMConfig.KeyType.PercentKey + "blockResistance", GMConfig.PropertyType.Block));//格挡
        blockResistance.Add(null);
        blockResistance.Add(new PropertyValue<object>(4, GMConfig.KeyType.PercentKey + "blockResistance", GMConfig.PropertyType.Block));//格挡
        blockResistance.Add(null);
        blockResistance.Add(new PropertyValue<object>(6, GMConfig.KeyType.PercentKey + "blockResistance", GMConfig.PropertyType.Block));//格挡

        var weaponDamage = new List<PropertyValue<object>>();
        weaponDamage.Add(new PropertyValue<object>(2, GMConfig.KeyType.AddKey + "weaponDamage", GMConfig.PropertyType.WeaponDamage));//武器伤害
        weaponDamage.Add(null);
        weaponDamage.Add(new PropertyValue<object>(4, GMConfig.KeyType.AddKey + "weaponDamage", GMConfig.PropertyType.WeaponDamage));//武器伤害
        weaponDamage.Add(null);
        weaponDamage.Add(new PropertyValue<object>(6, GMConfig.KeyType.AddKey + "weaponDamage", GMConfig.PropertyType.WeaponDamage));//武器伤害

        propertyList.Add(thorns);
        propertyList.Add(puppetBlood);
        propertyList.Add(baseBlood);
        propertyList.Add(fireResistance);
        propertyList.Add(iceResistance);
        propertyList.Add(toxicResistance);
        propertyList.Add(blockResistance);
        propertyList.Add(weaponDamage);
    }

    public List<PropertyValue<object>> GetRandOne()
    {
        var random = new Random();
        var index = random.Next(0, propertyList.Count);
        return propertyList[index];
    }
}

/// <summary>
/// 套装所有可随机属性
/// </summary>
public class SuitRand
{
    public static SuitRandProperty suitRandProperty = new SuitRandProperty();
}